#include "tm_maya_plugin.h"
#include "tm_stdout_maya_export_target.h"

using namespace std;

MStatus TStdoutMayaExportTarget::GetOutputPath(MString& target)
{
	target = ""; //we don't need to check for a filename

	MStatus stat = MS::kSuccess;
	
	return stat;
}

MStatus TStdoutMayaExportTarget::SaveFile(MString filename)
{
	cout << "Done writing data to standard output." << endl;

	return MS::kSuccess;
}

void TStdoutMayaExportTarget::AddVertex(float x, float y, float z)
{
	cout << "Vertex: " << x << " " << y << " " << z << " " << endl;
}

void TStdoutMayaExportTarget::AddNormal(float x, float y, float z)
{
	cout << "Normal: " << x << " " << y << " " << z << " " << endl;
}

void TStdoutMayaExportTarget::AddTangent(float x, float y, float z)
{
	cout << "Tangent: " << x << " " << y << " " << z << " " << endl;
}

void TStdoutMayaExportTarget::AddUV(float u, float v)
{
	cout << "UVs: " << u << " " << v << endl;
}

void TStdoutMayaExportTarget::AddTriangle(TMayaExportTriangle tri)
{
	cout << "Face with data:" << endl;
		
	for (int i=0; i<3; ++i)
		cout << tri.vertex_idx[i] << ", normal: " << tri.normal_idx[i] << ", uv: " << tri.uv_idx[i] << endl;
}
